import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_light_dark_demo/Utils/constant.dart';

import 'MainPgae.dart';
/**
 * Create by laoge
 * on 2021/5/6 0006
 */

class SplashPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    Size size = MediaQuery.of(context).size;
    return Scaffold(
      body: Stack(
        children: [
          Center(
            child: Image.asset(
              MediaQuery.of(context).platformBrightness == Brightness.light
                  ? "assets/images/splash_dark_bg.jpg"
                  : "assets/images/splash_light_bg.jpg",
              width: size.width * 2 / 3,
            ),
          ),
          Positioned(
            right: mDefaultPadding,
            bottom: mDefaultPadding,
            child: GestureDetector(
              onTap: () {
                Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
                  return MainPgae();
                }));
              },
              child: Container(
                padding: EdgeInsets.symmetric(
                    vertical: mDefaultPadding / 4, horizontal: mDefaultPadding),
                decoration: BoxDecoration(
                    color: Theme.of(context).scaffoldBackgroundColor,
                    boxShadow: [
                      BoxShadow(
                        color: Colors.grey,
                        blurRadius: 5,
                        offset: Offset(0, 0),
                        // spreadRadius: 5
                      )
                    ],
                    borderRadius: BorderRadius.all(Radius.circular(20))),
                child: Text(
                  "跳过",
                  style: Theme.of(context).textTheme.bodyText1,
                ),
              ),
            ),
          )
        ],
      ),
    );
  }
}
